package com.github.code.adapter

import android.content.Context
import android.view.LayoutInflater
import android.view.ViewGroup
import com.github.base.list.BaseRecyclerViewAdapter1
import com.github.base.list.BaseRecyclerViewAdapter1ViewHolder
import com.github.code.R
import com.github.code.databinding.LayoutItemBinding


/**
 *
 *
 * @author <a href="https://github.com/karai-oss">Mr.xie</a>
 * @Date 2025/4/25
 */

class StringListAdapter(var context: Context) :
    BaseRecyclerViewAdapter1<LayoutItemBinding, String>() {
    override fun onBindViewHolder(
        holder: BaseRecyclerViewAdapter1ViewHolder<LayoutItemBinding>,
        position: Int,
        data: String,
        binding: LayoutItemBinding
    ) {

        binding.tvName.text = data
    }

    override fun setItemBinding(parent: ViewGroup, viewType: Int): LayoutItemBinding {
        return LayoutItemBinding.bind(
            LayoutInflater.from(context).inflate(R.layout.layout_item, parent, false)
        )
    }
}